package cn.hnu.jpa.jpaExample.PrimaryKeyJoinColumn;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
public class PKJCAddress implements Serializable {

	/**
	 * 主键关联
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer id;
	
	private String addr;
	
	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	private PKJCCustomer customer;
	
	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	@OneToOne
	@PrimaryKeyJoinColumn
	public PKJCCustomer getCustomer() {
		return customer;
	}

	public void setCustomer(PKJCCustomer customer) {
		this.customer = customer;
	}
	
	
}
